There is a computer function (and on many modern calculators) named $\text{atan2}(y,x)$ that will return a correct angle from the signed rise and run data that went into getting a slope. Use two points on the line and compute $y$ and $x$ as $$\left[\begin{array}{c} y\\ x \end{array}\right]=\left[\begin{array}{c} y_{1}-y_{2}\\ x_{1}-x_{2} \end{array}\right]$$ I have shown these upside down, $y$ first and $x$ second, because that is how many computer implementations of the functions require them. (But! There are plenty of exceptions where the order of input is $\text{atan2}(x,y)$ instead of $\text{atan2}(y,x).$ Buyer beware.) The result of the atan2 function for line AC is shown in the figure. Effectively, the angle returned is the angle that the line would make with the $x$-axis if it were extended to meet that axis.
If you want the returned angle to be between $0$ and $\pi$, then $y$ must be positive. If $y<0$, the returned angle will be between $-\pi$ and $0$. Also, the returned value will always be in the interval $-\pi<\theta<\pi$.